package v1

import (
	"github.com/gogf/gf/v2/frame/g"
	"github.com/gogf/gf/v2/os/gtime"
	"wh-1-backend/internal/model"
)

type GetResumePageListReq struct {
	g.Meta   `path:"/resumes" tags:"Resume" method:"get" summary:"人才"`
	Username string `json:"username" v:"length:1,20"`
	Phone    string `json:"phone" v:"length:1,11"`
	PageCommonReq
}

type SimpleResumeList struct {
	Id         uint        `json:"id"`
	Username   string      `json:"username"`
	Phone      string      `json:"phone"`
	Company    interface{} `json:"company"`
	CompanyId  uint        `json:"companyId"`
	FunctionId uint        `json:"functionId"`
	Function   interface{} `json:"function"`
	CityId     uint        `json:"cityId"`
	City       interface{} `json:"city"`
	Salary     int         `json:"salary"`
	Birthday   string      `json:"birthday"`
	CreatedAt  *gtime.Time `json:"createdAt"` //
	UpdatedAt  *gtime.Time `json:"updatedAt"` //
}
type GetResumePageListRes struct {
	Total int                 `json:"total"`
	List  []*SimpleResumeList `json:"list"`
}

type WorkExperienceReq struct {
	Id        uint   `json:"id"        v:"required"`      //
	From      string `json:"from"      v:"required|date"` //
	End       string `json:"end"       v:"date"`          //
	CompanyId uint   `json:"companyId" v:"required"`      //
	Remarks   string `json:"remarks"   v:"required"`      //
}

type ProjectExperienceReq struct {
	Id      uint   `json:"id"        v:"required"`      //
	From    string `json:"from"      v:"required|date"` //
	End     string `json:"end"       v:"required|date"` //
	Title   string `json:"title"     v:"required"`      //
	Content string `json:"content"   v:"required"`      //
}

type EditResumeReq struct {
	Username              string `json:"username" v:"required|length:2,12"`
	Phone                 string `json:"phone" v:"required|length:6,20"`
	Birthday              string `json:"birthday" v:"date"`
	Gender                uint   `json:"gender" v:"in:0,1,2"`
	QQ                    string `json:"qq" v:"length:3,20"`
	Wx                    string `json:"wx" v:"length:4,20"`
	Email                 string `json:"email" v:"length:6,30"`
	Salary                int    `json:"salary"`
	CompanyId             uint   `json:"companyId"`
	NationalityId         uint   `json:"nationalityId"`
	EducationBackgroundId uint   `json:"educationBackgroundId"`
	FromId                uint   `json:"fromId"`
	CityId                uint   `json:"cityId"`
	FunctionId            uint   `json:"functionId"`
	IndustryId            uint   `json:"industryId"`
	SelfEvaluation        string `json:"selfEvaluation"`
}
type EditResume1Req struct {
	EditResumeReq
	WorkExperience    []WorkExperienceReq
	ProjectExperience []ProjectExperienceReq
}

type CreateResumeReq struct {
	g.Meta `path:"/resume" tags:"Resume" method:"post" summary:"人才"`
	EditResume1Req
}
type ModifyResumeReq struct {
	g.Meta `path:"/resume/{Id}" tags:"Resume" method:"put" summary:"人才"`
	Id     uint `json:"id" in:"path" v:"required"`
	EditResume1Req
}

type GetResumeDetailReq struct {
	g.Meta `path:"/resume/{Id}" tags:"Resume" method:"get" summary:"人才"`
	Id     uint `json:"id" in:"path" v:"required"`
}

type GetResumeDetailRes struct {
	model.ResumeDetail1
}

type DeleteResumeReq struct {
	g.Meta `path:"/resume" tags:"Resume" method:"delete" summary:"人才"`
	Ids    []uint `json:"ids" v:"required"`
}
